$(document).ready(function() {

	$('#getCheckCodeBtn').click(function() {
		$.ajax({
			type: 'POST',
			url: 'http://192.168.1.221:8080/mainview/getBrandShopList.do?brandId=36&lat=30.283088&lng=120.131400',
			data: '',
			success: function(data) {
				var btn = $(this);
				btn.addClass('waiting');
				btn.attr('disabled', true);
				var i = 60;
				var change = function(i) {
					if (i == 0) {
						clearInterval(interval);
						btn.removeClass('waiting');
						btn.attr('disabled', false);
						btn.html('获取');
					} else {
						btn.html(i);
					}
				}
				change(i);
				i--;
				var interval = setInterval(function() {
					change(i);
					i--;
				}, 1000);
				console.log('ajax success');

			},
			error: function() {

			}.
			dataType: 'json'
		});
	});

	
});